﻿using Miao;
using Miao.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

/// <summary>
/// 固定时间隐藏Panel
/// </summary>
abstract public class TimerHidePanel:UIMotionPanel
{
    public DelayCallHandle delayCallHandle;
    abstract public float HideTime { get; }
    public float Timer = 0;

    protected override void OnImmediatelyShow()
    {
        Timer = 0;
        delayCallHandle = Miao.MiaoRuntime.Updater.AddDelayCall(Hide, HideTime);
        base.OnImmediatelyShow();
    }

    private void OnDestroy()
    {
        delayCallHandle?.Kill();
    }

}

